<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>医生评估</title>
	<#include "/common/resource.ftl">
</head>
<body>

<div class="ui-operation">
    <div class="ui-search-items layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" class="layui-input">
                </div>
            </div>
        </div>
    </div>
    <div class="ui-buttons">
        <div class="layui-btn-group tools">
            <button class="layui-btn layui-btn-normal singleSelected" p="url:'${params.contextPath}/view/business/elder/doctor_approval',title:'医生评估通过',width:'90%',height:'100%'"><i class="fa fa-check"></i>同意</button>
            <button class="layui-btn layui-btn-normal singleSelected" p="url:'${params.contextPath}/view/business/elder/doctor_reject',title:'医生评估驳回',width:'90%',height:'100%'"><i class="fa fa-close"></i>驳回</button>
        </div>
        <div class="ui-searchs">
            <input type="button" value="搜索" class="layui-btn layui-btn-danger search-button"/>
        </div>
    </div>
</div>
<div class="ui-content" style="padding-left: 10px;padding-right:10px;">
    <table id="datagrid" options="url:'${params.contextPath}/web/elder/list',params:'getSearchParams',dblClickRow:'showDetail'">
        <thead>
			<tr>
				<th data-options="field:'id',checkbox:true"></th>
				<th data-options="field:'name',width:100,align:'left'">姓名</th>
                <th data-options="field:'sex',width:80,align:'left',formatter:formatSex">性别</th>
                <th data-options="field:'birthDate',width:110,align:'left'">出生年月</th>
                <th data-options="field:'idcard',width:160,align:'left'">身份证号</th>
				<th data-options="field:'code',width:150,align:'left'">入院号</th>
				<th data-options="field:'bedNum',width:150,align:'left'">床位号</th>
				<th data-options="field:'checkInDateStr',width:150,align:'left'">入住日期</th>
				<th data-options="field:'nursingLevelStr',width:100,align:'left'">护理等级</th>
				<th data-options="field:'statusStr',width:150,align:'left'">状态</th>
			</tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function getSearchParams() {
        return {
            name: $("input[name='name']").val(),
            status: 1
        };
    }
    var showDetail = function (index, row) {
        <@auth code='elder_detail'>
            var url = "${params.contextPath}/view/business/elder/elder_detail?id=" + row.id;
            DialogManager.openDialog("url:'" + url + "',title:'老人入院登记表详情',width:'90%',height:'100%'");
        </@auth>
    };
    //formatter:formatState
	var sexOperator = "";
	function formatSex(row) {
		if (!sexOperator) {
			sexOperator = DictionaryHelper.getDictionaryOperator("sex");
		}
		return sexOperator.getDictionaryItemName(row.sex);
	}

    $(function () {
        $(".remove-button").click(function () {
            var ids = DataGrid.getCheckedIds();
            if (ids == "") {
                layer.msg("请选择删除记录")
                return false;
            }
            var url = $(this).attr("reurl");
            layer.confirm('确定删除记录', function () {
                $.ajaxRequest({
                    type: 'post',
                    url: url,
                    data: {ids: ids.join(",")},
                    success: function (data) {
                        $.message(data.message);
                        if (data.success) {
                            DataGrid.reload();
                        }
                    }
                });
            });
        });
        //end
    });
</script>
</body>

</html>
